// Package transmission_type 模型
package transmission_type

import (
	// "gitee.com/sweetsunnyflower/carpooling-server-go/pkg/logger"
	"gitee.com/sweetsunnyflower/carpooling-server-go/app/models"
	"gitee.com/sweetsunnyflower/carpooling-server-go/pkg/database"
)

type TransmissionType struct {
	models.BaseModel
	Name string `gorm:"type:varchar(100);" db:"name" json:"name" form:"name"`
	models.CommonTimestampsField
}

func (transmissionType *TransmissionType) Create() {
	database.DB.Create(&transmissionType)
}

func (transmissionType *TransmissionType) Save() (rowsAffected int64) {
	result := database.DB.Save(&transmissionType)
	return result.RowsAffected
}

func (transmissionType *TransmissionType) Delete() (rowsAffected int64) {
	result := database.DB.Delete(&transmissionType)
	return result.RowsAffected
}
